﻿<%@ Page Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="supplierView.aspx.cs" Inherits="supplierView" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="conSearch" Runat="Server">
    &nbsp;
            <div class="AccordionPanel">
        	    <div class="AccordionPanelTab"><b class="contentcolor">Supplier</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
        	    <div class="AccordionPanelContent">
        	      <br />
     <div style="text-align:left; height: 40px;" >
       <div> 
         <asp:Label ID="Label1" runat="server" Text="Supplier Nº"></asp:Label>
        
&nbsp;<asp:TextBox ID="txtSuplierId" runat="server" Height="16px" Width="185px" ></asp:TextBox>
      </div>
         <br />
         
         <div>
           <asp:Label ID="Label2" runat="server" Text="Supplier name"></asp:Label>
             
&nbsp;<asp:TextBox ID="txtSupplierName" runat="server" Height="16px" Width="185px" ></asp:TextBox>
        </div>
        <br />
        <div>
              <asp:Label ID="Label3" runat="server" Text="Category"></asp:Label>
             
&nbsp;

          <asp:DropDownList ID="dlCategory" runat="server"  Width="187px"  Height ="23px"

        

                 AppendDataBoundItems="True" DataSourceID="dsCategory" 
                 DataTextField="CategoryName" DataValueField="CategoryId" >
              <asp:ListItem Value="-1">--- Choose Category ---</asp:ListItem>
    
         </asp:DropDownList>
             
             <asp:ObjectDataSource ID="dsCategory" runat="server" SelectMethod="GetCategory" 
                 TypeName="Service.ReferenceData.ReferenceDataServiceSupplier">
             </asp:ObjectDataSource>
             
       
        </div>
        <br />
        <div>
        <asp:Label ID="Label4" runat="server" Text="Vat" Width="185px"></asp:Label>
        
             

&nbsp;<asp:TextBox ID="txtVat" runat="server" Height="16px" Width="185px" ></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      </div> 
      <br />
      <div>   <asp:Label ID="Label5" runat="server" Text="Phone"></asp:Label>
             

&nbsp;<asp:TextBox ID="txtPhone" runat="server" Height="16px" Width="185px" ></asp:TextBox>

          
        </div>
                
           
             <br />
             <div style="height: 30px" align="right">

                 <asp:Button CssClass="btnexpress" BorderStyle="Dotted" ID="bntSearch" 
                     runat="server" Text="Search" onclick="bntFilter_Click" />
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             </div>
         </div>
     </div> 
 </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="m_contentBody" Runat="Server">

    <body onload ="TabbedPanels1.showPanel(<%=GetTabIndex()%>)">
    
         <asp:TextBox ID="txtHiddenSupplierId" runat="server" Width="77px" 
            Visible="False"></asp:TextBox>                          
    <div id="containerright" class="containerright">
          <div id="TabbedPanels1" class="TabbedPanels" >
                <ul class="TabbedPanelsTabGroup">
                  <li class="TabbedPanelsTab" tabindex="0">List supplier</li>
                  <li class="TabbedPanelsTab" tabindex="1">Supplier Detail </li>
                   <li class="TabbedPanelsTab" tabindex="2">List contact</li>
                </ul>
              <div class="TabbedPanelsContentGroup" >

                  <div class="TabbedPanelsContent" >
                   
 
<table  class="GridItem" cellspacing="2" cellpadding="2" 
                          style="width:auto;height:350px;text-align:center">
<tr><td align="center" class="BigLabel" >
         <asp:Label ID="lblTotalSupplier" runat="server" Text="Label"></asp:Label><asp:Label ID="lblPermission" runat="server" CssClass="permissionstyle"></asp:Label>
        </td></tr>
        
        
<tr >
             <td  align="center" class="GridItem"  style="text-align:center">
             <asp:GridView ID="grdSupplier1" runat="server" AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                  
                     CellPadding="4" ForeColor="#333333" GridLines="None">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >
             
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
         </tr>        
<tr><td align="center" class="GridItem"  style="text-align:left">
<asp:UpdatePanel ID="updatePanelEquipment" runat="server">
            <ContentTemplate>
            
       <div style=" height:350px; width:auto; overflow:auto">
                <asp:GridView ID="grdSupplier" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" BorderStyle="None" 
                    CssClass="GridItem" DataSourceID="dsSupplier" RowHeaderColumn="EquipmentId" 
                   DataKeyNames="CompanyId" onrowcommand="grdSupplier_RowCommand" 
                    onrowdatabound="grdSupplier_RowDataBound" 
                    onpageindexchanging="grdSupplier_PageIndexChanging">
                    
                    <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                    <Columns>
                    <asp:CommandField ShowSelectButton="True"  />
                      
                     
                        <asp:TemplateField>
                            <ItemTemplate>
                
                              <a title="Detail" href="supplierView.aspx?tabIndex=1&companyId=<%# DataBinder.Eval(Container.DataItem, "CompanyId") %>" > 
                                    <img border=0 src="./images/edit.png" width="20" height="20">
                                </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a title="Delete" href="javascript:confirmDelete('supplierView.aspx?delete=true&tabIndex=0&companyId=<%# DataBinder.Eval(Container.DataItem, "CompanyId")%>&pageIndex=<%=GetPageIndex()%>')"> 
                                    <img border=0 src="./images/del.png" width="15" height="15" >
                                </a>
                          <%--     &pageIndex=<%=GetPageIndex()%>--%>
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField >
                            <ItemTemplate >  
                                <a title="Contact" href="supplierView.aspx?tabIndex=2&companyId=<%# DataBinder.Eval(Container.DataItem, "CompanyId") %>" > 
                               <img border=0 src="./images/contact2.png" width="30" height="30">
                              </a> 
                            </ItemTemplate>
                            <ItemStyle Width="15px" />
                        </asp:TemplateField>
                         
                        <asp:BoundField DataField="CompanyId" HeaderText="Nº" ReadOnly="True">
                            <ItemStyle Width="50px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Company name">
                            <ItemTemplate>
                                <%# Eval("CompanyName")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                &nbsp;<asp:TextBox ID="textBox0" runat="server" Text='<%# Bind("CompanyName") %>' 
                                     Width="95%"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        
                       
                        <asp:TemplateField HeaderText="Category">
                              <ItemTemplate>
                                <%# Eval("CategoryLabel")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                &nbsp;<asp:TextBox ID="textBox1" runat="server" Text='<%# Bind("CategoryLabel") %>' 
                                     Width="95%"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        
                    
                           <asp:BoundField DataField="Vat" HeaderText="Vat" ReadOnly="True" 
                            DataFormatString="{0:n2}">
                            <ItemStyle Width="50px" HorizontalAlign="Right" />
                        </asp:BoundField>
                        
                        
                        <asp:TemplateField HeaderText="phone">
                                <ItemTemplate>
                                <%# Eval("Phone")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                &nbsp;<asp:TextBox ID="textBox3" runat="server" Text='<%# Bind("Phone") %>' 
                                     Width="95%"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="E-mail">
                         <ItemTemplate>
                                <%# Eval("Email")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                &nbsp;<asp:TextBox ID="textBox4" runat="server" Text='<%# Bind("Email") %>' 
                                     Width="95%"></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        
                       
                    </Columns>
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                </asp:GridView>
            </div>    
                 <asp:ObjectDataSource ID="dsSupplier" runat="server" 
                    SelectMethod="GetSupplierDisplayed" TypeName="DirectServiceSupplier" 
                    UpdateMethod="UpdateSupplier" onselected="dsSupplier_Selected1"  
                    >
                     <UpdateParameters>
                         <asp:Parameter Name="companyId" Type="Int32" />
                         <asp:Parameter Name="companyName" Type="String" />
                         <asp:Parameter Name="categoryId" Type="Int32" />
                         
                         <asp:Parameter Name="vat" Type="Single" />
                         
                         <asp:Parameter Name="phone" Type="String" />
                         <asp:Parameter Name="email" Type="String" />
                     </UpdateParameters>
                     <SelectParameters>
                         <asp:ControlParameter ControlID="txtHiddenWhereClause" Name="WhereClause" 
                             PropertyName="Text" Type="String" />
                         <asp:Parameter Name="orderclause" Type="String" />
                     </SelectParameters>
                </asp:ObjectDataSource>
                
    </td></tr>
     
   <tr><td>
    <asp:TextBox ID="txtHiddenPageIndex" runat="server" Visible="false"></asp:TextBox>
    <a id="detailPosition"></a>
       <asp:TextBox ID="txtHiddenWhereClause" runat="server" Height="17px" Width="205px" Visible="False"></asp:TextBox>
       <asp:TextBox ID="txthiddenOrderbyClause" runat="server"  Width="64px" 
            Visible="False"></asp:TextBox>
              <Triggers>
              
                <asp:AsyncPostBackTrigger ControlID="txtHiddenWhereClause" EventName="TextChanged" />
                
            </Triggers>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txthiddenOrderbyClause" EventName="TextChanged" />
            </Triggers>
        	    </ContentTemplate>
        	    </asp:UpdatePanel>
     
                   
         </td></tr>
        
              
    </table>
            
             </div>
             
                  <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="SupplierAdd.aspx?&companyId=<%=GetSupplierId()%>"  frameborder="0" ></iframe></div>
             
                 <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="Contacts.aspx?&companyId=<%=GetSupplierId()%>"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                        
                       <%-- <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="SupplierAdd.aspx"  frameborder="0" ></iframe></div>
             
                 <div class="TabbedPanelsContent" >
                        <iframe  class="FrameDimension" src="Contacts.aspx"  frameborder="0" ></iframe></div><!--This content will be included not use Iframe when using dynamique programing-->
                    
                        
                  --%>
           </div>      
    </div>
 
 </body>
 
 <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    
 </script>
   
</asp:Content>
